import { defineHopeConfig } from "vuepress-theme-hope";
import sidebar from "./sidebar";
import { comment } from "vuepress-plugin-comment2";


export default defineHopeConfig({
  base: "/",

  dest: "./dist",

  head: [
    [
      "link",
      {
        rel: "stylesheet",
        href: "//at.alicdn.com/t/font_2410206_mfj6e1vbwo.css",
      },
    ],
  ],

  locales: {
    "/": {
      lang: "zh-CN",
      title: "负雪明烛",
      description: "负雪明烛的刷题博客，LeetCode算法题解、刷题模板",
    },
  },

  themeConfig: {

    navbar: [
      {
        text: "首页",
        icon: "home",
        link: "/",
      },
      {
        text: "LeetCode 题解",
        icon: "guide",
        link: "/leetcode/README.md",
      },
      {
        text: "DDIA",
        icon: "read",
        link: "/ddia/README.md",
      },
      {
        text: "求职内推",
        icon: "selection",
        link: "https://offer.yoga",
      },
      {
        text: "标签",
        icon: "tag",
        link: "/tag/easy",
      },
      {
        text: "留言板",
        icon: "comment",
        link: "/message-board.md",
      },
    ],

    sidebar: {
      "/leetcode/": "false",
      "/ddia/": [
        "",
        "chapter1",
        "chapter2",
        "chapter3",
        "chapter4",
        "chapter5",
        "chapter6",
        "chapter7",
        "chapter8",
        "chapter9",
        "chapter10",
        "chapter11",
        "chapter12"
      ],
    },

    hostname: "http://fuxuemingzhu.cn",

    author: {
      name: "负雪明烛",
      url: "http://fuxuemingzhu.cn",
    },

    iconPrefix: "iconfont icon-",

    logo: "/logo.png",

    repo: "https://github.com/fuxuemingzhu/Leetcode-Solution-All",
    // 自定义仓库链接文字。默认从 `themeConfig.repo` 中自动推断为
    // "GitHub" / "GitLab" / "Gitee" / "Bitbucket" 其中之一，或是 "Source"。
    repoLabel: "GitHub",
    // 是否在导航栏内显示仓库链接，默认为 `true`
    repoDisplay: true,
    // 是否显示编辑此页
    editLinks: false,

    docsDir: "demo/src",

    encrypt: {
      config: {
        "/guide/encrypt.html": ["1234"],
      },
    },

    themeColor: false,
    footer: "关注负雪明烛，算法学习不迷路！ 备案号：<a href=\"https://beian.miit.gov.cn/\">京ICP备19006885号-1</a>",
    displayFooter: true,

    plugins: {
      blog: true,
      comment: {
        comment: true,
        type: "giscus",
        repo: "fuxuemingzhu/Leetcode-Solution-All",
        repoId: "MDEwOlJlcG9zaXRvcnkzMzkyNzE0MDQ=",
        category: "General",
        categoryId: "DIC_kwDOFDje7M4COTjn"
      },

      mdEnhance: {
        enableAll: true,
        presentation: {
          plugins: ["highlight", "math", "search", "notes", "zoom"],
        },
      },

      '@renovamen/vuepress-plugin-baidu-tongji': {
        'ba': 'de15700da34699e02e0ead3da5cb273b'
      },

      pwa: {
        favicon: "/favicon.ico",
        cachePic: true,
        apple: {
          icon: "/assets/icon/apple-icon-152.png",
          statusBarColor: "black",
        },
        msTile: {
          image: "/assets/icon/ms-icon-144.png",
          color: "#ffffff",
        },
        manifest: {
          icons: [
            {
              src: "/assets/icon/chrome-mask-512.png",
              sizes: "512x512",
              purpose: "maskable",
              type: "image/png",
            },
            {
              src: "/assets/icon/chrome-mask-192.png",
              sizes: "192x192",
              purpose: "maskable",
              type: "image/png",
            },
            {
              src: "/assets/icon/chrome-512.png",
              sizes: "512x512",
              type: "image/png",
            },
            {
              src: "/assets/icon/chrome-192.png",
              sizes: "192x192",
              type: "image/png",
            },
          ],
          shortcuts: [
            {
              name: "Guide",
              short_name: "Guide",
              url: "/guide/",
              icons: [
                {
                  src: "/assets/icon/guide-maskable.png",
                  sizes: "192x192",
                  purpose: "maskable",
                  type: "image/png",
                },
                {
                  src: "/assets/icon/guide-monochrome.png",
                  sizes: "192x192",
                  purpose: "monochrome",
                  type: "image/png",
                },
              ],
            },
            {
              name: "LeetCode",
              short_name: "LeetCode",
              url: "/leetcode/",
              icons: [
                {
                  src: "/assets/icon/guide-maskable.png",
                  sizes: "192x192",
                  purpose: "maskable",
                  type: "image/png",
                },
                {
                  src: "/assets/icon/guide-monochrome.png",
                  sizes: "192x192",
                  purpose: "monochrome",
                  type: "image/png",
                },
              ],
            },
          ],
        },
      },
    },
  }
});
